# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Apigee.V1.Model.GoogleCloudApigeeV1DnsZone do
  @moduledoc """
  A DNS zone is a resource under an Apigee organization that is used to create a DNS peering with Apigee's network. DNS peering will let Apigee instances resolve the hostnames created in a peered network.

  ## Attributes

  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The time that this resource was created on the server.
  *   `description` (*type:* `String.t`, *default:* `nil`) - Required. Description of the resource. String of at most 1024 characters associated with this resource for the user's convenience.
  *   `domain` (*type:* `String.t`, *default:* `nil`) - Required. The domain name for hosts in this private zone, for instance "example.com.".
  *   `name` (*type:* `String.t`, *default:* `nil`) - Identifier. Unique name for the resource. Defined by the server Format: "organizations/{organization}/dnsZones/{dns_zone}".
  *   `peeringConfig` (*type:* `GoogleApi.Apigee.V1.Model.GoogleCloudApigeeV1DnsZonePeeringConfig.t`, *default:* `nil`) - DNS PEERING zone configuration.
  *   `state` (*type:* `String.t`, *default:* `nil`) - Output only. State of the DNS Peering. Values other than `ACTIVE` mean the resource is not ready to use.
  *   `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The time that this resource was updated on the server.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :createTime => DateTime.t() | nil,
          :description => String.t() | nil,
          :domain => String.t() | nil,
          :name => String.t() | nil,
          :peeringConfig =>
            GoogleApi.Apigee.V1.Model.GoogleCloudApigeeV1DnsZonePeeringConfig.t() | nil,
          :state => String.t() | nil,
          :updateTime => DateTime.t() | nil
        }

  field(:createTime, as: DateTime)
  field(:description)
  field(:domain)
  field(:name)
  field(:peeringConfig, as: GoogleApi.Apigee.V1.Model.GoogleCloudApigeeV1DnsZonePeeringConfig)
  field(:state)
  field(:updateTime, as: DateTime)
end

defimpl Poison.Decoder, for: GoogleApi.Apigee.V1.Model.GoogleCloudApigeeV1DnsZone do
  def decode(value, options) do
    GoogleApi.Apigee.V1.Model.GoogleCloudApigeeV1DnsZone.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Apigee.V1.Model.GoogleCloudApigeeV1DnsZone do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
